package com.sxhalo.fsms.quartz;

import jdk.nashorn.internal.runtime.regexp.joni.ast.StringNode;

public enum AlarmEnum {



	//报警来源
	SourceSystem("system", "系统上报"),
	SourcePatrol("patrol", "常规巡检"),
	SourceManual("Manual", "手动上报"),
	SourceSelf("self", "设备本身"),


	//报警级别
	LevelWarning("801", "警告"),
	LevelAlarm("802", "报警"),
	LevelFault("803", "故障"),

	//报警类别
	CategoryAlarm("601", "报警"),
	CategoryHigh2("602", "高高报警"),
	CategoryHigh("603", "高报警"),
	CategoryLow("604", "低低报警"),
	CategoryLow2("605", "低低报警");



	/**
	 * 报警来源
	 */
	private final String code;

	/**
	 * 报警来源信息
	 */
	private final String msg;

	public String getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}

	AlarmEnum(String code, String msg) {
		this.code = code;
		this.msg = msg;
	}


	public static String getCategoryMsg(String i) {
		switch(i) {
			case "601":
				return  CategoryAlarm.getMsg();
			case "602":
				return  CategoryHigh2.getMsg();
			case "603":
				return  CategoryHigh.getMsg();
			case "604":
				return  CategoryLow.getMsg();
			case "605":
				return  CategoryLow2.getMsg();
			default:
				return  CategoryAlarm.getMsg();
		}
	}

	public static String getLevelMsg(String i) {
		switch(i) {
			case "801":
				return  LevelWarning.getMsg();
			case "802":
				return  LevelAlarm.getMsg();
			case "803":
				return  LevelFault.getMsg();
			default:
				return  LevelAlarm.getMsg();
		}
	}


	public static String getSourceMsg(String i) {
		switch(i) {
			case "system":
				return  SourceSystem.getMsg();
			case "patrol":
				return  SourcePatrol.getMsg();
			case "Manual":
				return  SourceManual.getMsg();
			case "self":
				return  SourceSelf.getMsg();

			default:
				return  SourceSystem.getMsg();
		}
	}

}
